<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  xmlns:fo="http://www.w3.org/1999/XSL/Format" 
  xmlns:xlink="http://www.w3.org/1999/xlink" exclude-result-prefixes="xlink">
 <xsl:output method="xml" indent="yes"/>
 <xsl:template match="/">
  <fo:root>
   
    <fo:layout-master-set>
    <fo:simple-page-master master-name="A4" page-height="29.7cm" page-width="21cm" >
    <fo:region-body region-name="xsl-region-body" margin="2cm" /> <!-- Corps de page -->
    <fo:region-before region-name="xsl-region-before" extent="1cm" margin="2cm"  /> <!-- En-tete de page -->
    <fo:region-after region-name="xsl-region-after" extent="1cm" /> <!-- Pied de page -->
    </fo:simple-page-master>
  </fo:layout-master-set>

  <fo:page-sequence master-reference="A4" initial-page-number="1">
     
       <!-- En-tete de page -->
    <fo:static-content flow-name="xsl-region-before">
      <fo:block-container padding-before="2mm">
    <fo:block text-align="center" font-size="18pt" background-color="#CEEEEE" color="#1531ec">LISTE des PERSONNES</fo:block>  
      </fo:block-container>
    </fo:static-content>
     
    <!-- Pied de page -->
    <fo:static-content flow-name="xsl-region-after">
    <fo:block text-align="right" margin-right="1cm">Page <fo:page-number/> sur <fo:page-number-citation ref-id="last-page"/>
    </fo:block>      
    </fo:static-content>


    <!-- Corps de page -->
      <fo:flow flow-name="xsl-region-body">
        <xsl:apply-templates select="Personnes/CV">
          <xsl:sort select="Nom" />
        </xsl:apply-templates>
        <!-- Pour récupérer le nombre total de pages -->
          <fo:block id="last-page"/>
     
        <!-- Fin de Corps de page -->
        </fo:flow>
  </fo:page-sequence>
 
</fo:root>
</xsl:template>
 
 
 <xsl:template match="Personnes/CV">
 <fo:block-container>
  <fo:block>
    <fo:inline font-size="16pt" font-variant="small-caps"><xsl:value-of select="Nom"/>   </fo:inline>
    <fo:inline font-size="14pt"><xsl:text> </xsl:text><xsl:value-of select="Prenom"/></fo:inline>
  </fo:block>
  <fo:block padding-after="3mm"/>
</fo:block-container>
 </xsl:template>      


</xsl:stylesheet>


